home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form Examples
- BackColor = &H00C0C0C0&
- BorderStyle = 1 'Fixed Single
- Caption = "Examples"
- ClientHeight = 5370
- ClientLeft = 1380
- ClientTop = 1380
- ClientWidth = 8745
- Height = 5775
- Left = 1320
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MDIChild = -1 'True
- MinButton = 0 'False
- ScaleHeight = 358
- ScaleMode = 3 'Pixel
- ScaleWidth = 583
- Top = 1035
- Width = 8865
- Begin CommandButton Command1
- Caption = "Start"
- Height = 372
- Left = 3480
- TabIndex = 6
- Top = 4920
- Width = 1812
- End
- Begin Timer Timer6
- Enabled = 0 'False
- Interval = 100
- Left = 480
- Top = 4920
- End
- Begin Timer Timer5
- Enabled = 0 'False
- Interval = 1000
- Left = 120
- Top = 4920
- End
- Begin CAR Car1
- AutoRedraw = -1 'True
- BackgroundColor = &H00000000&
- BackgroundPicture= CEXAMPLE.FRX:0000
- BevelInner = 1 ' 1 - Raised
- BevelOuter = 2 ' 2 - Inset
- BevelWidth = 2
- BorderType = 1 ' 1 - Bevel
- BorderWidth = 2
- CaptionColor = &H0000FFFF&
- Danger = 6
- Delta = 1
- FrameColor = &H00000000&
- FrameScaleX = 0
- FrameScaleY = 0
- FrameStyle = 0 ' 0 - None
- GaugeType = 5 ' 5 - Volts
- Height = 2292
- HubColor = &H00808080&
- HubScale = 0.15
- Index = 5
- Left = 5880
- Max = 10
- Min = 0
- MouseControl = 0 'False
- NeedleColor = &H00FF0000&
- OutlineAlign = 0 ' 0 - Left
- OutlineColor = &H00000000&
- OutlineTitle = ""
- OutlineWidth = 0
- ShowDanger = -1 'True
- ShowWarning = -1 'True
- TabIndex = 5
- TicColor = &H00FFFFFF&
- Top = 2520
- Value = 0
- Warning = 5
- Width = 2772
- End
- Begin CAR Car1
- AutoRedraw = -1 'True
- BackgroundColor = &H00000000&
- BackgroundPicture= CEXAMPLE.FRX:58DA
- BevelInner = 1 ' 1 - Raised
- BevelOuter = 2 ' 2 - Inset
- BevelWidth = 2
- BorderType = 1 ' 1 - Bevel
- BorderWidth = 2
- CaptionColor = &H0000FFFF&
- Danger = 6
- Delta = 1
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "Arial"
- FontSize = 6.75
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- FrameColor = &H00000000&
- FrameScaleX = 0
- FrameScaleY = 0
- FrameStyle = 0 ' 0 - None
- GaugeType = 4 ' 4 - Water Temp
- Height = 2292
- HubColor = &H00808080&
- HubScale = 0.15
- Index = 4
- Left = 3000
- Max = 10
- Min = 0
- MouseControl = 0 'False
- NeedleColor = &H00FF0000&
- OutlineAlign = 0 ' 0 - Left
- OutlineColor = &H00000000&
- OutlineTitle = ""
- OutlineWidth = 0
- ShowDanger = -1 'True
- ShowWarning = -1 'True
- TabIndex = 4
- TicColor = &H00FFFFFF&
- Top = 2520
- Value = 0
- Warning = 5
- Width = 2772
- End
- Begin CAR Car1
- AutoRedraw = -1 'True
- BackgroundColor = &H00000000&
- BackgroundPicture= CEXAMPLE.FRX:AFF4
- BevelInner = 1 ' 1 - Raised
- BevelOuter = 2 ' 2 - Inset
- BevelWidth = 2
- BorderType = 1 ' 1 - Bevel
- BorderWidth = 2
- CaptionColor = &H0000FFFF&
- Danger = 6
- Delta = 1
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "Arial"
- FontSize = 6.75
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- FrameColor = &H00000000&
- FrameScaleX = 0
- FrameScaleY = 0
- FrameStyle = 0 ' 0 - None
- GaugeType = 3 ' 3 - Oil Pressure
- Height = 2292
- HubColor = &H00808080&
- HubScale = 0.15
- Index = 3
- Left = 120
- Max = 10
- Min = 0
- MouseControl = 0 'False
- NeedleColor = &H00FF0000&
- OutlineAlign = 0 ' 0 - Left
- OutlineColor = &H00000000&
- OutlineTitle = ""
- OutlineWidth = 0
- ShowDanger = -1 'True
- ShowWarning = -1 'True
- TabIndex = 3
- TicColor = &H00FFFFFF&
- Top = 2520
- Value = 0
- Warning = 5
- Width = 2772
- End
- Begin CAR Car1
- AutoRedraw = -1 'True
- BackgroundColor = &H00000000&
- BackgroundPicture= CEXAMPLE.FRX:103F6
- BevelInner = 1 ' 1 - Raised
- BevelOuter = 2 ' 2 - Inset
- BevelWidth = 2
- BorderType = 1 ' 1 - Bevel
- BorderWidth = 2
- CaptionColor = &H0000FFFF&
- Danger = 6
- Delta = 1
- FrameColor = &H00000000&
- FrameScaleX = 0
- FrameScaleY = 0
- FrameStyle = 0 ' 0 - None
- GaugeType = 2 ' 2 - Fuel
- Height = 2292
- HubColor = &H00808080&
- HubScale = 0.15
- Index = 2
- Left = 5880
- Max = 10
- Min = 0
- MouseControl = 0 'False
- NeedleColor = &H00FF0000&
- OutlineAlign = 0 ' 0 - Left
- OutlineColor = &H00000000&
- OutlineTitle = ""
- OutlineWidth = 0
- ShowDanger = -1 'True
- ShowWarning = -1 'True
- TabIndex = 2
- TicColor = &H00FFFFFF&
- Top = 120
- Value = 0
- Warning = 5
- Width = 2772
- End
- Begin CAR Car1
- AutoRedraw = -1 'True
- BackgroundColor = &H00000000&
- BevelInner = 1 ' 1 - Raised
- BevelOuter = 2 ' 2 - Inset
- BevelWidth = 2
- BorderType = 1 ' 1 - Bevel
- BorderWidth = 2
- CaptionColor = &H0000FFFF&
- Danger = 6
- Delta = 1
- FrameColor = &H00000000&
- FrameScaleX = 0
- FrameScaleY = 0
- FrameStyle = 0 ' 0 - None
- GaugeType = 1 ' 1 - Speedometer
- Height = 2292
- HubColor = &H00808080&
- HubScale = 0.15
- Index = 1
- Left = 3000
- Max = 10
- Min = 0
- MouseControl = 0 'False
- NeedleColor = &H00FF0000&
- OutlineAlign = 0 ' 0 - Left
- OutlineColor = &H00000000&
- OutlineTitle = ""
- OutlineWidth = 0
- ShowDanger = -1 'True
- ShowWarning = -1 'True
- TabIndex = 1
- TicColor = &H00FFFFFF&
- Top = 120
- Value = 0
- Warning = 5
- Width = 2772
- End
- Begin CAR Car1
- AutoRedraw = -1 'True
- BackgroundColor = &H00000000&
- BevelInner = 1 ' 1 - Raised
- BevelOuter = 2 ' 2 - Inset
- BevelWidth = 2
- BorderType = 1 ' 1 - Bevel
- BorderWidth = 2
- CaptionColor = &H0000FFFF&
- Danger = 6
- Delta = 1
- FrameColor = &H00000000&
- FrameScaleX = 0
- FrameScaleY = 0
- FrameStyle = 0 ' 0 - None
- GaugeType = 0 ' 0 - Tach
- Height = 2292
- HubColor = &H00808080&
- HubScale = 0.15
- Index = 0
- Left = 120
- Max = 10
- Min = 0
- MouseControl = 0 'False
- NeedleColor = &H00FF0000&
- OutlineAlign = 0 ' 0 - Left
- OutlineColor = &H00000000&
- OutlineTitle = ""
- OutlineWidth = 0
- ShowDanger = -1 'True
- ShowWarning = -1 'True
- TabIndex = 0
- TicColor = &H00FFFFFF&
- Top = 120
- Value = 0
- Warning = 5
- Width = 2772
- End
- Begin Timer Timer4
- Enabled = 0 'False
- Interval = 1000
- Left = 6390
- Top = 7065
- End
- Begin Timer Timer3
- Enabled = 0 'False
- Interval = 1000
- Left = 6360
- Top = 6630
- End
- Begin Timer Timer2
- Enabled = 0 'False
- Interval = 200
- Left = 6360
- Top = 7500
- End
- Begin Timer Timer1
- Enabled = 0 'False
- Interval = 1
- Left = 6360
- Top = 7950
- End
- Begin Label Label1
- Alignment = 2 'Center
- BackColor = &H00C0C0C0&
- Caption = "Label1"
- ForeColor = &H000000FF&
- Height = 372
- Left = 5760
- TabIndex = 7
- Top = 4920
- Width = 2772
- End
- Dim gasv As Single
- Dim speedv As Single
- Dim tachv As Single
- Dim oilv As Single
- Dim tempv As Single
- Dim voltv As Single
- Dim gear As Integer
- Dim voltinc As Single
- Dim oilinc As Single
- Dim tachinc As Single
- Dim speedinc As Single
- Dim tempinc As Single
- Sub Command1_Click ()
- Label1 = ""
- Timer1.Enabled = True
- Timer2.Enabled = True
- Timer3.Enabled = True
- Timer4.Enabled = True
- Timer5.Enabled = True
- ' Timer6.Enabled = True
- End Sub
- Sub Form_Load ()
- init_values
- Label1 = ""
- End Sub
- Sub Gauge3_Change ()
- End Sub
- Sub gauge7_change ()
- End Sub
- Sub Gauge7_Turn ()
- End Sub
- Sub init_values ()
- speedv = 0#
- tachv = 0#
- oilv = 0#
- gasv = 1#
- tempv = 100#
- voltv = 12
- gear = 1
- voltinc = .5
- speedinc = 1
- oilinc = 1
- tachinc = .2
- tempinc = 5
- Car1(0) = 0
- Car1(1) = 0
- Car1(2) = 1
- Car1(3) = 0
- Car1(4) = 100
- Car1(5) = 0
- End Sub
- Sub Timer1_Timer ()
- Car1(0) = tachv
- Car1(1) = speedv
- Car1(3) = oilv
- tachv = tachv + tachinc
- speedv = speedv + speedinc
- oilv = oilv + oilinc
- If tachv > 7 And gear < 4 Then
- tachv = 3
- gear = gear + 1
- gearlabel = Str(gear)
- ElseIf tachv > 7 Then
- tachv = 7
- End If
- If speedv > 130 Then
- speedv = 130
- End If
- If oilv > 60 Then
- oilv = 60
- End If
- End Sub
- Sub Timer2_Timer ()
- Car1(5) = voltv
- voltv = voltv + voltinc
- If voltv > 13.5 Then
- voltinc = -.4
- End If
- If voltv < 10 Then
- voltinc = .4
- End If
- End Sub
- Sub Timer3_Timer ()
- Car1(4) = tempv
- tempv = tempv + tempinc
- If tempv > 230 Then
- tempinc = -1#
- End If
- If tempv > 200 And tempv < 230 Then
- tempinc = 1#
- End If
- End Sub
- Sub Timer4_Timer ()
- Car1(3) = oilv
- oilv = oilv + 2
- End Sub
- Sub Timer5_Timer ()
- Car1(2) = gasv
- gasv = gasv - .01
- If gasv <= 0# Then
- Label1 = "Out of GAS!"
- Timer1.Enabled = False
- Timer2.Enabled = False
- Timer3.Enabled = False
- Timer4.Enabled = False
- Timer4.Enabled = False
- Timer5.Enabled = False
- init_values
- End If
- End Sub
- Sub Timer6_Timer ()
- Car1(1) = speedv
- speedv = speedv + 2
- If speedv > 130 Then
- speedv = 130
- End If
- End Sub
-